import {commonUrl, getRequest, uploadFile, uploadFileRequest} from "@/libs/axios";

// 通过id获取子地區
export const getChildRegion = (id) => {
  return getRequest(`${commonUrl}/common/common/region/item/${id}`);
};

// 点地图获取地址信息
export const getRegion = (params) => {
  return getRequest(`${commonUrl}/common/common/region/region`, params);
};

// 获取IM接口前缀
export function getIMDetail() {
  return getRequest(`${commonUrl}/common/common/IM`);
}

//获取图片logo
export function getBaseSite() {
  return getRequest(`${commonUrl}/common/common/site`);
}

// 上傳文件
export const upLoadFileMethods = (bold) => {
  return uploadFileRequest(uploadFile, bold);
};

/**
 * 發送短信驗證碼
 */
export function sendSms(params) {
  return getRequest(`${commonUrl}/common/common/sms/${params.verificationEnums}/${params.mobile}`, params);
}

// 根据域名获取店铺ID
export const findStoreByHost = (params) => {
  return getRequest(`${commonUrl}/common/common/store/host/` + params, params);
};
